var path = require('path');
var express = require('express');
var proxy = require('http-proxy-middleware');

var base_path = path.dirname(__dirname);
var config = require(path.join(
    base_path,
    'config.json'
));

var router = express.Router();

router.use(/.*/, proxy({
    target: config.server.api,
    changeOrigin: true
}));

module.exports = router;